package com.itmayiedu.app;

import com.itmayiedu.core.DbConfig.MasterConfig;
import com.itmayiedu.core.DbConfig.SlaveConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * Created by Devin on 2018/1/21.
 */
@ComponentScan(basePackages = {"com.itmayiedu.controller","com.itmayiedu.core","com.itmayiedu.service"})
@EnableJpaRepositories(basePackages = "com.itmayiedu.dao")
@EntityScan(basePackages = "com.itmayiedu.model")
//@MapperScan(basePackages = "com.itmayiedu.mapper")
@EnableConfigurationProperties(value = {MasterConfig.class, SlaveConfig.class})//atomikos配置注解
@EnableCaching //表示开启缓存注解
@EnableScheduling //表示开启定时任务注解
@EnableAsync //表示开启异步线程注解
@EnableAutoConfiguration
public class Application {

    public static void main(String[] args) {
        SpringApplication.run(Application.class,args);
    }
}
